<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="manageruser">
<head>
    <title>创建实体</title>
    <aside th:replace="temp :: Head"></aside>
</head>
<body class="cbp-spmenu-push">
<div class="main-content">
    <!--left-fixed -navigation-->
    <aside th:replace="temp :: menuAndHead"></aside>
    <!--left-fixed -navigation-->
    <!-- main content start-->
    <div id="page-wrapper">
        <div class="main-page">
            <aside th:replace="temp :: alert"></aside>
            <!--grids-->
            <div class="grids">
                <div class="progressbar-heading grids-heading">
                    <h2>创建实体</h2>
                </div>
                <div class="panel panel-widget forms-panel">
                    <div class="forms">
                        <div class=" form-grids form-grids-right">
                            <div class="widget-shadow " data-example-id="basic-forms">
                                <div class="form-title">
                                    <h4>实体:</h4>
                                </div>
                                <div class="form-body">
                                    <form class="form-horizontal" action="/edition/create" method="post">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">版本</label>
                                            <div class="col-sm-9">
                                                <select id="editionName" name="projectId"
                                                        class="selectpicker show-tick form-control"
                                                        data-live-search="true">
                                                </select>
                                            </div>
                                        </div>
                                        <hr/>
                                        <div class="form-group">
                                            <p>
                                                <label style="color: #d58512;font-size: large">package&nbsp;&nbsp;</label>
                                                <input class="demo-grid" name="packageName"
                                                       placeholder="com.example.demo">
                                                <label style="color: #d58512;font-size: large">;</label>
                                            </p>
                                            <br/>

                                            <p style="color: #0F9E5E">/**</p>
                                            <p style="color: #0F9E5E">&nbsp;* @Auther:<input class="demo-grid"
                                                                                             name="auther"
                                                                                             placeholder="administrator">
                                            </p>
                                            <p style="color: #0F9E5E">&nbsp;* @Date: <label>[[${#dates.format(new
                                                java.util.Date().getTime(), 'yyyy/MM/dd HH:mm')}]]</label></p>
                                            <p style="color: #0F9E5E"><label>&nbsp;* @Description:</label><input
                                                    class="demo-grid" name="description" placeholder="实体类"></p>
                                            <p style="color: #0F9E5E">&nbsp;*/</p>
                                            <br/>
                                            <p>
                                                <label style="color: #d58512;font-size: large">public&nbsp;&nbsp;class&nbsp;&nbsp;</label>
                                                <input class="demo-grid" name="packageName" placeholder="Entity Name">
                                                <label style="font-size: large">{</label>
                                            </p>
                                            <br/>
                                            <p id="fields"></p>
                                            <br/>
                                            <p>
                                                <label style="text-indent:3em;"><input type="text" class="demo-grid" id="notes" name="notes" placeholder="注释"></label>
                                                <br />
                                                <label style="text-indent:2em;color: #d58512;font-size: large">private
                                                    <input style="color: #6164C1" class="demo-grid" id="type"
                                                           name="type" placeholder="Entity Type">
                                                    <input class="demo-grid" id="fieldName" name="fieldName"
                                                           style="color: #00aced"
                                                           placeholder="Field Name"><span>;</span></label>
                                                <button th:align="right" type="button"
                                                        class="btn btn-success warning_2 "
                                                        onclick="addField();"> +
                                                </button>
                                            </p>
                                            <br/>
                                            <p id="getset"></p>
                                            <br/>
                                            <p><label style="font-size: large">}</label></p>
                                            <hr/>
                                            <p><div align="right"><button type="button" class="btn btn_5 btn-lg btn-success warning_1">保存</button></div></p>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--//grids-->
        </div>
    </div>
    <!--footer-->
    <div class="dev-page">

        <!-- page footer -->
        <!-- dev-page-footer-closed dev-page-footer-fixed -->
        <div class="dev-page-footer dev-page-footer-fixed">
            <!-- container -->
            <div class="container">

                <div class="dev-page-footer-container">

                    <!-- loader and close button -->
                    <div class="dev-page-footer-container-layer">
                        <a href="#" class="dev-page-footer-container-layer-button"></a>
                    </div>


                    <!-- //page footer container -->

                </div>
                <!-- //container -->
            </div>
            <!-- /page footer -->
        </div>
        <!--//footer-->
    </div>
</div>
<script>
    $(function () {
        $.ajax({
            url: "/edition/findProjectByName",
            method: "post",
            success: function (data) {
                $("#editionName").empty();
                var childs = "";
                for (var i = 0; i < data.length; i++) {
                    childs += "<option value='" + data[i].editionId + "'>" + data[i].editionName + "</option>";
                }
                $("#editionName").append(childs);
                $('.selectpicker').selectpicker('refresh');
            }
        })
    })
</script>
<script src="/js/myTool.js"></script>
<aside th:replace="temp :: endJS"></aside>
</body>
</html>